package opration;

import book.Book;
import book.BookList;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 张宇田
 * Date: 2024-10-14
 * Time: 18:50
 */
public class addBook implements IOprable{
    @Override
    public void work(BookList bookList) {
        System.out.println("新增图书");
        BookList bookList1 = new BookList();
        int size = bookList1.getSize();
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你要新增的图书名字");
        String name = sc.nextLine();
        System.out.println("请输入你要新增的图书作者");
        String author = sc.nextLine();
        System.out.println("请输入你要新增的图书价格");
        int price = sc.nextInt();
        System.out.println("请输入你要新增的图书类型");
        String type = sc.nextLine();
        Book book = new Book(name,author,price,type);
        bookList1.putBook(size + 1,book);
        //return;

    }
}
